import { memo } from 'react'
import { Navigate } from 'react-router-dom'

const RouteAuth = ({ children }) => { // 路由权限验证
  const token = window.storage.get('token')
  console.log(token)
  if (!token) {
    return <Navigate to='/login' replace={true}/>
  }
  return <>
    {children}
  </>
}

export default memo(RouteAuth)